var opeForm;
var operationType;
$(function() {

    opeForm = $('#opeForm');
	operationType = $("#operationType").val();
	
	if (operationType == 1) {
		opeForm.url = "BD_ADMIN_MANAGE!doInsert.do";
	
	} else {
		opeForm.url = 'BD_ADMIN_MANAGE!doUpdate.do';
	}
	
	$("#saveBtn").click(doSave);
	$("#cancelBtn").click(closeWin);
});

// Save operation
function doSave() {
	var options = {
		url : opeForm.url,
		type : 'post',
		success : function(data) {
			parent.afterSave();
			alert('Operation successfull!');
			closeWin();
		}
	};
	
	opeForm.ajaxSubmit(options);

}
